package com.testinterface;

//测试接口的多继承
public class TestMultipleInheritance {
    public static void main(String[] args) {
        C c1 = new CImol01();
        c1.testA();
        c1.testB();
        c1.testC();
    }
}

interface A{
    default void testA(){
        System.out.println("接口A");
    }
}

interface B{
    default void testB(){
        System.out.println("接口B");
    }
}

interface C extends A,B{
    @Override
    default void testA() {
        System.out.println("接口A");
    }

    @Override
    default void testB() {
        System.out.println("接口B");
    }

    default void testC(){
        System.out.println("接口C");
    }
}

class CImol01 implements C{

    @Override
    public void testA() {
        System.out.println("接口A！");
    }

    @Override
    public void testB() {
        System.out.println("接口B！");
    }

    @Override
    public void testC() {
        System.out.println("接口C！");
    }
}